package cn.edu.gzgs.mapper;

import cn.edu.gzgs.dto.AuditContentDTO;
import cn.edu.gzgs.entity.AuditContent;
import cn.edu.gzgs.entity.AuditRecord;
import cn.edu.gzgs.vo.AuditContentVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface AuditMapper extends BaseMapper<AuditContent> {

    /**
     * 插入审核记录
     * @param auditRecord
     */
    @Insert("insert into audit_record(applicant_teacher_id, audit_teacher_id, latest_audit_teacher_id,audit_content_id) " +
            "values(#{applicantTeacherId}, #{auditTeacherId}, #{latestAuditTeacherId},#{auditContentId})")
    void insertAuditRecord(AuditRecord auditRecord);

    @Select("select * from audit_content where list_meta_id = #{listMetaId} and submitter_id= #{submitterId}")
    AuditContent selectByCheck(AuditContentDTO auditContentDTO);

    @Delete("delete from audit_record where audit_content_id =#{id}")
    void deleteBatchContentIds(Long id);
}
